<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head><title>ISERN - Display Data</title></head>
<body>

<font size="+3" face="Arial">ISERN</font><br>
<font size="0">International Software Engineering Research Network</font><br>

<table width="100%" bgcolor="#B57EDC"><tr><td>
      <stripes:form id="PushForm" action="/MyIsern.action">
        Select table to display:
          <stripes:select size="1" name="listToDisplay">
            <stripes:option value="R">Researchers</stripes:option>
            <stripes:option value="C">Collaborations</stripes:option>
            <stripes:option value="O">Organizations</stripes:option>
          </stripes:select>
        <stripes:submit value="Display" name="display"/>
      </stripes:form>
</td><td width="50">
      <stripes:form id="logout" action="/Login.action">
        <stripes:submit value="logout" name="logout"/>
      </stripes:form>
</td>
</tr></table>
 
<p>
<table id="ErrorMessageTable">
  <tr><td><font color="red">${actionBean.errorMessage}</font></td></tr>
</table>

 <p>
 Contents of table:<br>
 <stripes:form id="TableForm" action="/MyIsern.action">
 <stripes:submit value="New Entry" name="addElement"/>
 <table id="dataTable" border="1">
   <tr>
   <c:forEach var="element" items="${actionBean.headerIterator}">
     <td>${element}</td>
   </c:forEach>
   </tr>
   <c:forEach var="row" items="${actionBean.dataIterator}">
     <tr>
     <stripes:form id="InnerForm" action="/MyIsern.action">
     <stripes:hidden name="thisRow" value="${row}"/>
     <stripes:hidden name="listToDisplay" value="${listToDisplay}"/>
     <c:forEach var="item" items="${row}">
       <td>${item}</td>
     </c:forEach>
     <td>
	 <stripes:submit value="Edit Row" name="edit"/>
	 </stripes:form>
	 </td>  
     </tr>
   </c:forEach>
 </table>
 </stripes:form>

<p>
<hr>
<font size="-1">
<b>Debug info:</b><br>
Reading data files from: ${actionBean.baseFolder} <br>
</font

></body>
</html>

